<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>公共详情页面</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="./../../../favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="./../../../static/css/font.css">
    <link rel="stylesheet" href="./../../../static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../../static/css/buildUnit/common.css">
    <style>
        .baoShen, .fpList {
            display: none;
        }

        .bsShow .baoShen, .fpShow .fpList {
            display: block;
        }

        .checkLi_1010, checkLi_1020, checkLi_1030 {
            display: none;
        }
    </style>
</head>
<body>
<div class="content" id="view">
    <script type="text/html" id="templateId">
        <!--报审详情-->
        {{#if(bsData.length>0){ }}
        <div class="layui-collapse baoShen" lay-filter="acceptCollapse" style="margin-bottom:10px;">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">审批详情</h2>
                <div class="layui-colla-content layui-show">
                    <!--<div style="padding-top:15px;"> 受理编号：{{bsData[0].applyCode || '-'}}</div>-->
                    <div style="padding-top:15px;"> 审查编号：{{bsCode || '-'}}</div>
                    <table class="layui-table v-table">
                        <thead>
                        <tr>
                            <th>受理方</th>
                            <th>受理机构</th>
                            <th>受理人</th>
                            <th>状态</th>
                            <th>受理意见</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{# layui.each(bsData,function(index,item){ }}
                        <tr>
                            <td>{{item.acceptTypeName || '-'}}</td>
                            <td>{{item.orgName || '-'}}</td>
                            <td>{{item.applyMan || '-'}}</br><span>联系方式:{{item.applyManTel || '-'}}</span></td>
                            <td>{{item.acceptStatus || '-'}}<br><span>时间：{{item.adviseTime || '-'}}</span></td>
                            <td>{{item.acceptAdvise || '-'}}</td>
                        </tr>
                        {{# }); }}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        {{#} }}
        <!--报审详情end-->
        <!--分配列表-->
        <div class="layui-collapse fpList" lay-filter="acceptCollapse" style="margin-bottom:10px;">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">分配列表</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table">
                        <colgroup>
                            <col width="25%">
                            <col width="25%">
                            <col width="25%">
                            <col width="25%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>所属专业</th>
                            <th>审查人</th>
                            <th>审核人</th>
                            <th>技术负责人</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{# layui.each(fpData.assignExpertDTOList, function(index, item){ }}
                        <tr>
                            <td>{{item.specialtyName}}</td>
                            <td>{{item.scrName}}</td>
                            <td>{{item.shrName}}</td>
                            <td>{{fpData.jsfzrName}}</td>
                        </tr>
                        {{# }); }}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!--分配列表end-->
        <div class="layui-tab tab" lay-filter="common_nav_tab" id="ApplyTabTip">
            <ul class="layui-tab-title" id="commonTabName">
                <li lay-id="singleProjectInfoTab" class="layui-this">{{d.tabItem[0].tabItemName}}</li>
                <li lay-id="drawListTab">{{d.tabItem[1].tabItemName}}</li>
                {{# layui.each(d.fjList,function(i,v){ }}
                <li lay-id="attaList{{i}}">{{v.tabItemName}}</li>
                {{# }); }}
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <iframe src='' frameborder="0" scrolling="no" name="singleIframe" class="weIframe iframe0"></iframe>
                </div>
                <div class="layui-tab-item">
                    <iframe src='' frameborder="0" scrolling="yes" class="weIframe iframe1"></iframe>
                </div>
                <div class="layui-tab-item">
                    <iframe src='' frameborder="0" scrolling="yes" name="zjfjIframe" class="weIframe iframe2"></iframe>
                </div>
                <div class="layui-tab-item">
                    <iframe src='' frameborder="0" scrolling="yes" name="xffjIframe" class="weIframe iframe3"></iframe>
                </div>
                <div class="layui-tab-item">
                    <iframe src='' frameborder="0" scrolling="yes" name="rffjIframe" class="weIframe iframe4"></iframe>
                </div>
            </div>
        </div>
    </script>

</div>
<script src="../../../static/js/main.js"></script>
<script>
    layui.use([ // 依赖模块注入
        'permission',
        'bluebird',
        'jquery',
        'element',
        'form',
        'configure',
        'configureCom',
        'tabHeight',
        'templateInit',
        'sessionFun'
    ], function () {
        var element = layui.element;
        var $ = layui.jquery;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var templateInit = layui.templateInit;
        var tabHeight = layui.tabHeight;
        var sessionFun = layui.sessionFun;
        var templateHtml = $('#templateId').html();

        //获取标段id 单体id
        configureCom.getUrlId();

        //报审详情
        window.bsData = [];
        if (configureCom.GetQueryString('bsShow')) {
            $('.content').addClass('bsShow');
            window.bsData = JSON.parse(localStorage.bsData);
        }

        window.reportType = sessionFun.get(configure.SESSION_REPORT_TYPE);
        window.bsCode = '';
        if (reportType == 1010 || reportType == 1030 || !reportType) {
            bsCode = '';
        } else {
            if(bsData.length){
                bsCode = bsData[0].applyCode;
            }
        }

        //分配列表
        window.fpData = [];
        if (configureCom.GetQueryString('ttSgProjApplyItemId')) {
            //查看分配表
            window.fpData = JSON.parse(localStorage.fpData);
            if (fpData.assignExpertDTOList.length > 0) {
                $('.content').addClass('fpShow');
            }
        }

        var by = '';//从哪儿个页面点进来的
        var imgListName = '勘察设计文件';
        var bdstType = '';
        if (configureCom.GetQueryString('by')) {
            by = configureCom.GetQueryString('by');
            var regKc = new RegExp(/^kc/);
            var regSj = new RegExp(/^sj/);
            if (regKc.test(by)) {
                imgListName = '勘察文件';
                bdstType = '1010';
            } else if (regSj.test(by)) {
                imgListName = '设计文件';
                bdstType = '1020';
            }
        }
        if (configureCom.GetQueryString('bdstType')) {
            bdstType = configureCom.GetQueryString('bdstType')
        }

        var commonDetail = {
            data: {
                singleProjectId: singleProjectId,//单位工程ID
                by: by,
                tabItem: [
                    {
                        tabItemName: '单位工程信息',
                        url: configure.SINGLE_PROJECT_INFO_DETAIL_HTML_HTTP
                        + '?bdstType=' + bdstType + '&singleProjectId=' + singleProjectId
                    },
                    {
                        tabItemName: imgListName,
                        url:
                        configure.DRWAING_LIST_READONLY_HTML + '?bdstType=' + bdstType + '&dtId=' + singleProjectId + (bdId ? '&bdId=' + bdId : '')
                    }
                ],
                fjList: []
            },
            render: function () {
                //报审了哪儿家机构 显示哪儿家的报审材料
                configureCom.getAjax(configure.SURVEYDESIGN_ACCEPT_TYPE_HTTP, {singleProjectId: singleProjectId}).then(function (res) {
                    if (configureCom.GetQueryString('bsShow') && res.msg) {
                        var typeString = res.msg;
                        var typeArr = typeString.split(';');
                        $.each(typeArr, function (index, item) {
                            var checkType = (parseInt(item) - 1000) / 10 + 1;
                            var name = '';
                            if (checkType == '2') {
                                name = '住建';
                            } else if (checkType == '3') {
                                name = '消防';
                            } else if (checkType == '4') {
                                name = '人防';
                            }
                            var obj = {
                                tabItemName: name + '报审材料',
                                url:
                                configure.ATTA_LIST_HTML + '?checkType=' + checkType + '&type=detail&dataId=' + singleProjectId
                            };
                            commonDetail.data.fjList.push(obj);
                        });
                    }
                    //渲染模板
                    templateInit.init('view', commonDetail.data, templateHtml);
                    element.render('tab');
                    tabHeight.init();

                    $('.iframe0').attr('src', configureCom.nocache(commonDetail.data.tabItem[0].url));
                    //切换tab
                    element.on('tab(common_nav_tab)', function (res) {
                        if (!$('.iframe' + res.index).attr('src')) {
                            if (res.index < 2) {
                                $('.iframe' + res.index).attr('src', configureCom.nocache(commonDetail.data.tabItem[res.index].url));
                            } else {
                                $('.iframe' + res.index).attr('src', configureCom.nocache(commonDetail.data.fjList[res.index - 2].url));
                            }
                        }
                    });
                });
            }
        };
        commonDetail.render();
    });
</script>
</body>
</html>